package com.aptech.oas.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="t_vacation")
@SequenceGenerator(name="vacationSeq",sequenceName="seq_vacation")
public class Vacation implements Serializable{


	private Long vid;
	private User applicant;
	private User approver;
	private Date startTime;
	private Date endTime;
	private Integer days;
	private String reason;
	private Byte status=0;

	public Vacation() {
		super();
	}

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="vacationSeq")
	public Long getVid() {
		return vid;
	}

	public void setVid(Long vid) {
		this.vid = vid;
	}


	@ManyToOne
	@JoinColumn(name="applicant")
	public User getApplicant() {
		return applicant;
	}

	public void setApplicant(User applicant) {
		this.applicant = applicant;
	}

	@ManyToOne
	@JoinColumn(name="approver")
	public User getApprover() {
		return approver;
	}

	public void setApprover(User approver) {
		this.approver = approver;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public Integer getDays() {
		return days;
	}

	public void setDays(Integer days) {
		this.days = days;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Byte getStatus() {
		return status;
	}

	public void setStatus(Byte status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "Vacation [vid=" + vid + ", applicant=" + applicant + ", approver=" + approver + ", startTime="
				+ startTime + ", endTime=" + endTime + ", days=" + days + ", reason=" + reason + ", status=" + status
				+ "]";
	}


}
